package obecto.utility
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;
	import flash.display.PixelSnapping;
	
	public class SnapshotUtility
	{
		public static function makeSnaphot(displayObject : DisplayObject) : Bitmap
		{
			var bitmapData : BitmapData = new BitmapData(
				displayObject.width + (displayObject.width % 2),
				displayObject.height + (displayObject.height % 2), 
				true, 0x00FF0000);
			bitmapData.draw(displayObject,  null, null, null, null, true);
			
			var result : Bitmap = new Bitmap(bitmapData, PixelSnapping.AUTO, true);
			return result;
		}

	}
}